home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / dflat_r_.arc / HTREE.H < prev    next >
Text File  |  1991-10-02  |  1KB  |  39 lines

  1. /* ------------------- htree.h -------------------- */
  2.  
  3. typedef unsigned int BYTECOUNTER;
  4.  
  5. /* ---- Huffman tree structure ---- */
  6. struct htree    {
  7.     unsigned char ch;       /* character value             */
  8.     BYTECOUNTER cnt;        /* character frequency         */
  9.     int parent;             /* offset to parent node       */
  10.     int right;              /* offset to right child node  */
  11.     int left;               /* offset to left child node   */
  12. };
  13.  
  14. extern struct htree *ht;
  15. extern int root;
  16.  
  17. #ifdef INCLUDE_COMPRESS_HELPFILE
  18.  
  19. void buildtree(void);
  20. FILE *OpenHelpFile(void);
  21. void HelpFilePosition(long *, int *);
  22. void *GetHelpLine(char *);
  23. void SeekHelpLine(long, int);
  24.  
  25. #else
  26.  
  27. #define OpenHelpFile()                \
  28. {                                    \
  29.     char hf[64];                    \
  30.     strcpy(hf, DFlatApplication);    \
  31.     strcat(hf, ".TXT");                \
  32.     helpfp=fopen(hf, "rt");            \
  33. }
  34. #define HelpFilePosition(o,b) *o=ftell(helpfp)
  35. #define GetHelpLine(s)        fgets(s,160,helpfp)
  36. #define SeekHelpLine(o,b)     fseek(helpfp,o,0)
  37.  
  38. #endif
  39.